// main.ts
import { createApp } from "vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import App from "@/App.vue";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import "virtual:svg-icons-register";
import gloablComponent from "@/components";
import "@/styles/index.scss";
import router from "./router";
import pinia from "./store";
import "@/permission";
import confirm from "./utils/confirm";
// 暗黑模式
import "element-plus/theme-chalk/dark/css-vars.css";
// 全局指令，判断按钮权限
import { isHasButtons } from "./directive/has";

const app = createApp(App);
app.config.globalProperties.Confirm = confirm;

app.use(ElementPlus, {
  locale: zhCn,
});
app.use(gloablComponent);
app.use(router);
app.use(pinia);
isHasButtons(app);
// console.log(import.meta.env);
app.mount("#app");
